package cn.amebius.simpledocker.entity.dto;

import cn.amebius.simpledocker.exception.DataErrorException;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * User和Role对应的Dto数据类
 * @author 阿伟
 * @date 2023/7/28 16:27
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserRoleInfoDto {


    private Integer roleId;

    private String name;

    private String designation;

    private String description;

    private Date createTime;

    public static void check(UserRoleInfoDto urid) {
        if (urid == null || urid.roleId.toString().isEmpty() || urid.name.isEmpty() || urid.description.isEmpty() || urid.designation.isEmpty() || urid.createTime.toString().isEmpty()) {
            throw new DataErrorException("数据异常:用户权限信息丢失");
        }
    }


}
